<%= form_for [:admin, @announcement] do |f| -%>
  <%= render :partial => "/shared/admin/error_messages", :locals => {
          :object => @announcement,
          :include_object_name => true
        } %>
  
  <div class='field'>
    <%= f.label :title -%>
    <%= f.text_field :title, :class => 'larger widest'  -%>
  </div>
  
  <div class='field'>
    <%= f.label :starts_at -%>
    <%= f.datetime_select :starts_at  -%>
  </div>
  
  <div class='field'>
    <%= f.label :ends_at -%>
    <%= f.datetime_select :ends_at  -%>
  </div>
  
  <div class='field'>
    <%= f.label :photo -%>
    <%= render :partial => "/shared/admin/image_picker", :locals => {
          :f => f,
          :field => :photo_id,
          :image => @announcement.photo,
          :toggle_image_display => false
        } %>
  </div>
  
  <div class='field'>
    <div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'>
      <ul id='page_parts'>
        <% [:description].each_with_index do |part, part_index| %>
          <li class='ui-state-default<%= ' ui-state-active' if part_index == 0 %>'>
            <%= link_to part.to_s.titleize, "##{part}" %>
          </li>
        <% end %>
      </ul>

      <div id='page_part_editors'>
        <% [:description].each do |part| %>
          <div class='page_part' id='<%= part %>'>
            <%= f.text_area part, :rows => 20, :class => 'wymeditor widest' -%>
          </div>
        <% end %>
      </div>
    </div>
  </div>
  
  <%= render :partial => "/shared/admin/form_actions",
              :locals => {
                :f => f,
                :continue_editing => false,
                :delete_title => t('delete', :scope => 'admin.announcements.announcement'),
                :delete_confirmation => t('message', :scope => 'shared.admin.delete', :title => @announcement.title)
              } %>
<% end -%>
<% content_for :javascripts do %>
  <script>
    $(document).ready(function(){
      page_options.init(false, '', '');
    });
  </script>
<% end %>
